package com.example.demo.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.demo.custom.BaseService;
import com.example.demo.entity.AccessoriesChannels;
import com.example.demo.entity.AccessoriesChannels2;
import com.example.demo.repository.AccessoriesChannels2Repository;
@Service
public class AccessoriesChannels2Service extends BaseService<AccessoriesChannels2, Integer>{
	@Autowired
	private AccessoriesChannels2Repository Acc2DAO;

	public List<AccessoriesChannels2> findByAccessoriesChannelsId(Integer id) {
		return Acc2DAO.findByAccessoriesChannelsId(id);
	}

	public List<AccessoriesChannels2> findByAccessoriesChannels(AccessoriesChannels acc) {
		return Acc2DAO.findByAccessoriesChannels(acc);
	}
	
	/**
	 * 通过配件类别找到加价率
	 */
	public AccessoriesChannels2 findByCategory(String category) {
		return Acc2DAO.findByCategory(category);
	}

	public List<AccessoriesChannels2> findByAccessoriesChannelsNameAndCategory(String name, String category) {
		return Acc2DAO.findByAccessoriesChannelsNameAndCategory(name,category);
	}




}
